package com.hopes.bizz.risk.integral.vo;

import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author daijie
 * @version 1.0
 * @date 2023/7/20 15:58
 * @Description:
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "个人积分统计VO")
public class RiskIntegralStatisticalVO extends BaseLogicEntity {

    private static final long serialVersionUID = 6402049670028603636L;

    @Schema(description="标识")
    private Long id;

    @Schema(description="账户")
    private Long accountId;

    @Schema(description="积分总值")
    private Integer integral;

    @Schema(description="扣除积分值")
    private Integer deductIntegral;

    @Schema(description="加分积分值")
    private Integer earnIntegral;

    @Schema(description="可兑换积分")
    private Integer exchangeableIntegral;

    @Schema(description="机构ID")
    private Long orgId;

    public String getAccountIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_user, this.getAccountId());
    }

    public String getDeptIdStr() {
        String deptStr = null;
        String ext1 = DictResolver.getItemByValue(AdminDictEnum.sys_user, String.valueOf(this.getAccountId())).getExt1();
        if (ext1 != null) {
            deptStr = DictResolver.getItemLabelByValue(AdminDictEnum.sys_dept, ext1);
        }
        return deptStr;
    }
}
